package com.ethink.mdm.facade.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.framework.common.db.PageUtils;
import com.ethink.mdm.api.MateFacade;
import com.ethink.mdm.api.info.MateSkuInfo;
import com.ethink.mdm.api.request.GroupMateMateSkuQueryRequest;
import com.ethink.mdm.api.request.MateSkuQueryRequest;
import com.ethink.mdm.common.mapper.MateQueryMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * mateSku Facade接口实现
 *
 * @author default
 * @date 2022-10-31
 */
@RestController
@Slf4j
@RequestMapping("mdm-service/facade/v1/mate")
public class MateFacadeImpl implements MateFacade {

    @Autowired
    private MateQueryMapper mateQueryMapper;

    @Override
    public Page<MateSkuInfo> queryMateSku(MateSkuQueryRequest request) {
        return mateQueryMapper.queryMateSku(PageUtils.buildPage(request), request);
    }

    @Override
    public List<MateSkuInfo> queryMateSkuBySkuCodeList(List<String> mateSkuCodeList) {
        return mateQueryMapper.queryMateSkuBySkuCodeList(mateSkuCodeList);
    }

    @Override
    public MateSkuInfo getMateSkuBySkuCode(String mateSkuCode) {
        return mateQueryMapper.getMateSkuBySkuCode(mateSkuCode);
    }

}